This module contains pure functions for basic linear algebra operations.
Solves the eigenvalue problem where matrix is is square, but not necessarily symmetric. Optionally, the left eigenvalue problem can be solved such that .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The matrix . |
|
| logical, | intent(in), | optional | :: | right |
An optional parameter specifying if the right eigenvalue solution should be computed (true), or the left eigenvalue solution should be computed (false). The default is true such that the right eigenvalue problem is solved. |
The solution.
Solves the eigenvalue problem where and are both N-by-N matrices. Optionally, the left eigenvalue problem can be solved such that .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The matrix . |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | b |
The matrix . |
|
| logical, | intent(in), | optional | :: | right |
An optional parameter specifying if the right eigenvalue solution should be computed (true), or the left eigenvalue solution should be computed (false). The default is true such that the right eigenvalue problem is solved. |
The solution.
Solves the least squares problem by minimizing using a complete orthogonal factorization of .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix . |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | b |
The M-by-NRHS matrix . |
The resulting N-by-NRHS matrix .
Solves the least squares problem by minimizing using a complete orthogonal factorization of .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix . |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | b |
The M-element array . |
The resulting N-element array .
Solves the M-by-N linear system for .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix . |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | b |
The M-by-NRHS matrix . |
The resulting N-by-NRHS matrix .
Solves the M-by-N linear system for .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix . |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | b |
The M-element array . |
The resulting N-element array .
Solves a triangular system of the form where is a triangular matrix, either upper or lower, for equation .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The N-by-N triangular matrix. |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | b |
The N-by-NRHS matrix. |
|
| logical, | intent(in), | optional | :: | upper |
An optional argument specifying if the matrix is upper triangular (true), or lower triangular (false). The default assumption is that is an upper triangular matrix. |
The N-by-NRHS solution matrix, .
Solves a triangular system of the form where is a triangular matrix, either upper or lower, for equation .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The N-by-N triangular matrix. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | b |
The N-element array. |
|
| logical, | intent(in), | optional | :: | upper |
An optional argument specifying if the matrix is upper triangular (true), or lower triangular (false). The default assumption is that is an upper triangular matrix. |
The N-element solution array, .
A container for both eigenvectors and eigenvalues.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| complex(kind=real64), | public, | allocatable, dimension(:) | :: | values |
An array of eigenvalues. |
||
| complex(kind=real64), | public, | allocatable, dimension(:,:) | :: | vectors |
A collection of eigenvectors, stored columnwise. |
A container for the results of a LU factorization.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | L |
The lower-triangular factorization. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | P |
The pivot tracking matrix. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | U |
The upper-triangular factorization. |
A container for the results of a QR factorization of an M-by-N matrix.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | P |
The N-by-N pivot tracking matrix. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | Q |
The M-by-M orthogonal matrix, . |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | R |
The M-by-N upper trapezoidal matrix, . |
A container for the results of a singular value decomposition of an M-by-N matrix.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | S |
The M-by-N diagonal matrix containing the singular values on the diagonal. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | U |
The M-by-M orthogonal matrix . |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | Vt |
The transpose of the N-by-N right singular vector matrix . |
Computes the Cholesky factorization of a positive-definite matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The matrix to factor. |
|
| logical, | intent(in), | optional | :: | upper |
An optional parameter to specifiy if the upper factorization should be computed (true); else, false for the lower factorization . The default is to compute the upper factorization. |
The factored matrix, either or .
Constructs an N-by-N identity matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
The size of the matrix. |
The resulting matrix.
Computes the inverse of a square matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The N-by-N matrix to invert. |
The N-by-N inverted matrix.
Computes the LU factorization of a square matrix such that .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The N-by-N matrix to factor. |
The factored form of the matrix.
Computes the Moore-Penrose pseudoinverse of an M-by-N matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix to invert. |
The N-by-M inverted matrix.
Computes the QR factorization of an M-by-N matrix such that either (no pivoting), or (with pivoting).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix to factor. |
|
| logical, | intent(in), | optional | :: | pivot |
An optional parameter used to specifiy if pivoting should be used (true); else, false if no pivoting is used. The default is false such that no pivoting is performed. |
The factored form of the matrix.
Computes the singular value decomposition of an M-by-N matrix such that .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The M-by-N matrix to factor. |
The factored form of the matrix.
Swaps the contents of two arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:) | :: | x |
The first array. |
|
| real(kind=real64), | intent(inout), | dimension(:) | :: | y |
The second array. |